package com.woniuxy.buyer.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 站内消息实体
 */
@Data
@TableName("messages")
public class Message {

    @TableId(type = IdType.AUTO)
    private Long id;

    private Long senderId;

    private Long receiverId;

    private String title;

    private String content;

    private String type; // SYSTEM, USER, ORDER

    private Integer isRead; // 0-未读，1-已读

    private Long relatedOrderId;

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    private LocalDateTime readTime;

    // 非数据库字段
    @TableField(exist = false)
    private String senderName;

    @TableField(exist = false)
    private String receiverName;
}
